/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.designpatterns.creational.factorymethod;

import java.util.Date;

/**
 *
 * @author BassonCJ
 */
public class GenderFactory {
    private static GenderFactory genderFactory = null;
    
    private GenderFactory(){
        
    }
    
    public static GenderFactory getInstance(){
        if(genderFactory == null){
            return new GenderFactory();
        }
        return genderFactory;
    }
    
    public Date getDate(){
        return new Date();
    }
    
    public Gender getType(String type){
        if(type.equalsIgnoreCase("Male"))
            return new Male();
        else
            return new Female();
    }
}
